Electronic apparatus, angular velocity acquisition method and storage medium for the same

ABSTRACT

An electronic apparatus includes a magnetic sensor which acquires a status of a magnetic field around the electronic apparatus, an angular velocity sensor, and a processor. The processor controls whether the detection of an angular velocity of a spatial movement of the electronic apparatus is performed by the angular velocity sensor or a magnetic gyro sensor composed of the magnetic sensor, based on the status of the magnetic field acquired by the magnetic sensor.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a reissue of U.S. patent application Ser. No.15/377,355, filed Dec. 13, 2016 and issued as U.S. Pat. No. 10,365,106,which is based upon and claims the benefit of priority from the priorJapanese Patent Application No. 2015-248319, filed Dec. 21, 2015, theentire contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an electronic apparatus having anangular velocity detection function, an angular velocity acquisitionmethod for the electronic apparatus, and a storage medium having storedthereon an angular velocity acquisition program that is applied in theangular velocity acquisition method.

2. Description of the Related Art

In recent years, various electronic apparatuses such as cellular phones,smartphones (high- functionality cellular phone), navigation terminals,smart devices that are worn on human bodies and the like are widelyavailable.

In general, such electronic apparatuses are equipped with various typesof motion sensors including an angular velocity sensor (or gyro sensor)for detecting change in the angular velocity of an object.

This angular velocity sensor has been widely used in the fields ofattitude control for aircrafts and robots, image stabilization forimaging apparatuses, game controllers, etc. In recent years, it ismounted in smartphones and smart devices which are now significantlyprevalent, and used to acquire information regarding a user's exercisestatus, movement trajectory, and the like.

As such, the angular velocity sensor is a useful sensor that is capableof directly detecting change in the angular velocity of an electronicapparatus having the sensor or the angular velocity of the body motionof a user wearing or carrying the electronic apparatus. However, it isknown that its power consumption is generally large as compared to thoseof other motion sensors such as an acceleration sensor and a geomagneticsensor (or magnetic sensor). Therefore, when an angular velocity sensoris mounted in a battery-operated apparatus such as a portable electronicapparatus or a wearable apparatus, its driving time may become short.

Accordingly, a method has been proposed in which angular velocity iscalculated and estimated based on the output of a geomagnetic sensor orthe outputs of a geomagnetic sensor and an acceleration sensor, wherebya function equivalent to that of an angular velocity sensor is achieved,as described in International Publication No. 2007-099599.

This method for calculating angular velocity is a method using what iscalled a magnetic gyro sensor. In this method, in short, angularvelocity is calculated based on a temporal change in a geomagnetismvector detected by a geomagnetic sensor mounted in an electronicapparatus.

In general, the power consumption of a geomagnetic sensor is small ascompared to that of an angular velocity sensor. Therefore, theabove-described method using a magnetic gyro sensor has an effectcontributing to the improvement of the driving time of an electronicapparatus by reducing its power consumption.

However, geomagnetic sensors are easily affected by magnetic fieldsaround electronic apparatuses having these sensors or magnetism fromcomponents arranged around them in the electronic apparatuses.Accordingly, there is a problem in that, when a geomagnetic field thatis supposed to be detected by a geomagnetic sensor is affected by thesedisturbance noises, accurate angular velocities are difficult to becalculated.

SUMMARY OF THE INVENTION

The present invention has the advantage of providing an electronicapparatus having an angular velocity detection function that can detectan adequate angular velocity by reducing the effect of a surroundingmagnetic field while reducing power consumption, an angular velocityacquisition method of the electronic apparatus, and a storage mediumhaving an angular velocity acquisition program of the electronicapparatus stored thereon.

In accordance with one aspect of the present invention, there isprovided an electronic apparatus comprising: a magnetic sensor whichacquires a status of a magnetic field around the electronic apparatus;an angular velocity sensor; and a processor, wherein the processorcontrols whether detection of an angular velocity of a spatial movementof the electronic apparatus is performed by the angular velocity sensoror a magnetic gyro sensor composed of the magnetic sensor, based on thestatus of the magnetic field acquired by the magnetic sensor.

In accordance with another aspect of the present invention, there isprovided an angular velocity acquisition method for an electronicapparatus, wherein the electronic apparatus comprises a magnetic sensorwhich acquires a status of a magnetic field around the electronicapparatus, and an angular velocity sensor, and wherein the angularvelocity acquisition method comprises a control step of controllingwhether detection of an angular velocity of a spatial movement of theelectronic apparatus is performed by the angular velocity sensor or amagnetic gyro sensor composed of the magnetic sensor, based on thestatus of the magnetic field acquired by the magnetic sensor.

In accordance with another aspect of the present invention, there isprovided a non-transitory computer-readable storage medium having storedthereon an angular velocity acquisition program that is executable by acomputer in an electronic apparatus, wherein the electronic apparatuscomprises a magnetic sensor which acquires a status of a magnetic fieldaround the electronic apparatus, and an angular velocity sensor, andwherein the angular velocity acquisition program is executable by thecomputer to actualize functions comprising control processing forcontrolling whether detection of an angular velocity of a spatialmovement of the electronic apparatus is performed by the angularvelocity sensor or a magnetic gyro sensor composed of the magneticsensor, based on the status of the magnetic field acquired by themagnetic sensor.

The above and further objects and novel features of the presentinvention will more fully appear from the following detailed descriptionwhen the same is read in conjunction with the accompanying drawings. Itis to be expressly understood, however, that the drawings are for thepurpose of illustration only and are not intended as a definition of thelimits of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A, FIG. 1B and FIG. 1C are schematic structural diagrams showing aplurality of examples in which the present invention has been applied inan electronic apparatus;

FIG. 2 is a functional block diagram showing a first embodiment of anelectronic apparatus according to the present invention;

FIG. 3 is a first flowchart showing an example of an angular velocityacquisition method for the electronic apparatus according to the firstembodiment;

FIG. 4 is a second flowchart showing the example of the angular velocityacquisition method for the electronic apparatus according to the firstembodiment;

FIG. 5 is a timing chart showing the usage status of magnetic data inthe first embodiment;

FIG. 6 is a first flowchart showing an example of an angular velocityacquisition method for an electronic apparatus according to a secondembodiment; and

FIG. 7A, FIG. 7B and FIG. 7C are second flowcharts showing the exampleof the angular velocity acquisition method for the electronic apparatusaccording to the second embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

An electronic apparatus according to the present invention and anangular velocity acquisition method therefor will hereinafter bedescribed in detail with reference to the drawings.

<First Embodiment>

(Electronic Apparatus)

FIG. 1A, FIG. 1B and FIG. 1C are schematic structural diagrams showing aplurality of examples in which the present invention has been applied inan electronic apparatus.

FIG. 2 is a functional block diagram showing a first embodiment of anelectronic apparatus according to the present invention.

The present invention is applied in an electronic apparatus which has atleast an angular velocity detection function and provides a user withvarious services using information regarding the user's exercise status,movement trajectory, and the like.

More specifically, the present invention can be applied in a portable orwearable electronic apparatus, such as a smartwatch having awristwatch-type or wristband-type outer appearance as shown in FIG. 1A,an outdoor device 20 including a GPS Roger and a navigation terminal asshown in FIG. 1B, and a tablet terminal or a smartphone 30 shown in FIG.1C.

Note that the present invention is not limited to the electronicapparatuses shown in the drawings, and can be applied in a smart deviceor a sensor device that is worn on an arm, a leg, or the head of a humanbody, the neck or the chest on the trunk, or the waist, and detects andstores angular velocities of a corresponding body part.

In the descriptions below, these electronic apparatuses are collectivelyreferred to as “electronic apparatus 100” for convenience ofexplanation.

The electronic apparatus 100 according to the first embodiment of thepresent invention includes, for example, an acceleration sensor 110, amagnetic sensor 120, an angular velocity sensor (gyro sensor) 130, acommunication interface section (hereinafter briefly referred to as“communication I/F section”) 140, an input operation section 150, anoutput section 160, a control section (processor) 170, a memory section180, and a power supply section 190, as shown in FIG. 2 .

The acceleration sensor 110 measures the rate of change (acceleration)in the movement speed of the electronic apparatus 100 which occurs inresponse to the movement of the user's body.

This acceleration sensor 110, which includes a triaxial accelerationsensor, detects acceleration components (acceleration signals) in threeaxial directions orthogonal to one another, and outputs them asacceleration data.

The magnetic sensor 120, which includes a triaxial magnetic sensor,detects the earth's magnetic field as geomagnetic components (magneticsignals) in three axial directions orthogonal to one another, andoutputs it as magnetic data (or three-dimensional direction data).

The angular velocity sensor 130 measures change (angular velocity) inthe movement direction of the electronic apparatus 100 which occurs inresponse to the movement of the user's body.

This angular velocity sensor 130, which includes a triaxial angularvelocity sensor, detects angular velocity components (angular velocitysignals) in the rotation directions of rotational movements around threeaxes orthogonal to one another, and outputs them as angular velocitydata. Note that the three axial directions of the acceleration sensor110 and the three axial directions of the angular velocity sensor 130are set to be the same directions, respectively.

Pieces of sensor data (acceleration data, magnetic data, angularvelocity data) acquired by the acceleration sensor 110, the magneticsensor 120, and the angular velocity sensor 130 are respectivelyassociated with time data and stored in a predetermined storage area ofthe memory section 180.

The acceleration sensor 110 and the angular velocity sensor 130 functionas a motion sensor, and pieces of sensor data (acceleration data andmagnetic data) detected by these sensors are used when the controlsection 170 described later detects the user's body movement andexercise status, a specific directional force applied on the electronicapparatus 100, and the like.

Magnetic data detected by the magnetic sensor 120 is used when azimuthdirections relative to the electronic apparatus 100 are calculated inthe control section 170.

In this embodiment, the acceleration sensor 110 and the magnetic sensor120 function as a magnetic gyro sensor, and pieces of sensor data(acceleration data and magnetic data) detected by these sensors are usedwhen angular velocity is calculated in the control section 170.

The communication I/F section 140 transmits and receives various typesof data to and from an information and communication apparatus (apersonal computer, a smartphone, etc.) outside the electronic apparatus100 or a network. Here, in the communication via the communication I/Fsection 140, a predetermined wired or wireless communication method isused, which includes a transfer method where data is transferred via astorage medium such as a memory card.

The input operation section 150 includes, for example, an operationswitch 152 and a touch panel 154 provided on the housing of theelectronic apparatus 100 (the smartwatch 10, the outdoor device 20, thesmartphone 30) shown in FIG. 1 .

This input operation section 150 is used for various types of inputoperations, such as an operation related to the operation power supplyof the electronic apparatus 100 or application software, an operation ofsetting an item for which a notification is given by the output section160 (a display section, a sound section, etc.) described below.

The output section 160 has a display section 162, a sound section 164, avibration section (not shown in the drawing), and the like provided inthe housing of the electronic apparatus 100.

This output section 160 visually, aurally, or tactually provides theuser with or notifies the user of information regarding the user'sexercise status, movement trajectory, or the like and informationregarding the execution status of the later-described angular velocitycalculation processing which are generated based on sensor data acquiredby at least the acceleration sensor 110, the magnetic sensor 120, andthe angular velocity sensor 130 described above.

Note that, in a case where the electronic apparatus 100 is a smartdevice or a sensor device that is worn on the body and used only fordetecting and collecting sensor data of a corresponding body part, aconfiguration excluding the output section 160 may be adopted.

The control section (processor) 170 is an arithmetic processing unit(computer) having a clocking function, such as a CPU (Central ProcessingUnit) or a MPU (Micro Processing Unit), and controls operations such assensing operations by the acceleration sensor 110, the magnetic sensor120, and the angular velocity sensor 130 and an operation of generatinginformation regarding the user's exercise status, movement trajectory,or the like based on acquired sensor data, by executing a predeterminedcontrol program and a predetermined algorithm program.

In this embodiment, the control section 170 controls the operations ofthe angular velocity sensor 130 and the magnetic gyro sensor constitutedby the magnetic sensor 120 or constituted including the accelerationsensor 110 and the magnetic sensor 120, and thereby controls aprocessing operation for acquiring adequate angular velocity data. Notethat a method for acquiring angular velocity data in the presentembodiment is described later in detail.

The memory section 180 associates sensor data acquired by theacceleration sensor 110, the magnetic sensor 120, and the angularvelocity sensor 130, and various types of data generated (calculated) inthe control section 170 with time data, and stores them in thepredetermined storage area.

This memory section 180 stores control programs and algorithm programsthat are executed in the control section 170. Note that these programsmay be incorporated in advance in the control section 170.

In addition, the memory section 180 may be partially or entirely in aform of a removable storage medium such as a memory card, and may bestructured to be removable from the electronic apparatus 100.

The power supply section 190 supplies driving power to each section ofthe electronic apparatus 100. As the power supply section 190, a primarybattery such as a commercially-available coin-shaped battery, asecondary battery such as a lithium-ion battery, and a power supply byenergy harvest technology for generating electricity by energy such asvibrations, light, heat, and electro-magnetic waves can be used singlyor in combination.

(Angular Velocity Acquisition Method for Electronic Apparatus)

Next, an angular velocity acquisition method for the electronicapparatus according to the first embodiment is described with referenceto the drawings.

Note that the below-described angular velocity acquisition method(flowchart shown in FIG. 3 ) for the electronic apparatus 100 isachieved by the control section 170 performing processing in accordancewith a predetermined control program and a predetermined algorithmprogram.

FIG. 3 and FIG. 4 are flowcharts showing an example of the angularvelocity acquisition method for the electronic apparatus according tothe present embodiment.

FIG. 5 is a timing chart showing the usage status of magnetic data inthe present embodiment.

In the angular velocity acquisition method for the electronic apparatus100 according to the present embodiment, first, when the electronicapparatus 100 is turned on, the acceleration sensor 110, the magneticsensor 120, and the angular velocity sensor 130 are activated, and startsensing operations (Step S102), as shown in the flowchart in FIG. 3 .

Subsequently, the control section 170 judges whether or not there is anydisturbance or magnetic anomaly in a magnetic field around the magneticsensor 120 at this point (Step S104).

More specifically, the control section 170 first synchronizes theacceleration sensor 110 and the magnetic sensor 120 constituting amagnetic gyro sensor with the angular velocity sensor 130 so as tooperate them, and detects angular velocity from each output therefrom(Step S120), as shown in the flowchart in FIG. 4 .

Subsequently, the control section 170 compares the angular velocitiesdetected respectively by the magnetic gyro sensor and the angularvelocity sensor 130 with each other (Step S122).

Then, the control section 170 judges whether a difference between them,which is a result of the comparison, is within a threshold range set inadvance (Step S124). Here, a difference of an output from the magneticgyro sensor with respect to (with reference to) an output from theangular velocity sensor is determined as the comparison result, based onan assumption that the output from the angular velocity sensor isaccurate.

Note that the output of the angular velocity sensor 130 can bemaintained to be accurate by well-known calibration processing beingperformed periodically or constantly.

Then, when judged at Step S124 that the comparison result is within thethreshold range, the control section 170 judges that there is nomagnetic field disturbance or magnetic anomaly and the magnetic sensor120 is not being affected by any disturbance noise. That is, in thiscase, the control section 170 judges that the output of the magneticsensor 120 is reliable (Step S126).

Conversely, when judged that the comparison result is not within thethreshold range, the control section 170 judges that there is a magneticfield disturbance or magnetic anomaly and the magnetic sensor 120 isbeing affected by a disturbance noise.

That is, in this case, the control section 170 judges that the output ofthe magnetic sensor 120 is not reliable (Step S126).

Note that the series of processing operations shown in FIG. 4 ishereinafter referred to as “reliability judgment processing” forconvenience of explanation.

At Step S124, when judged that the comparison result is within thethreshold range (NO at Step S104), the control section 170 temporarilystops the sensing operation of the angular velocity sensor 130 (StepS106).

Then, the control section 170 performs an operation of detecting angularvelocity by using the magnetic gyro sensor constituted by the magneticsensor 120 or by the acceleration sensor 110 and the magnetic sensor 120(Step S108).

That is, when there is no magnetic field disturbance or magnetic anomalyand the output of the magnetic sensor 120 is reliable, the controlsection 170 selects the method of detecting angular velocity by themagnetic gyro sensor.

At Step S104, when judged that there is a magnetic field disturbance ormagnetic anomaly (YES at Step S104), the control section 170 judgeswhether the angular velocity sensor 130 is operating (Step S110). Then,when judged that the angular velocity sensor 130 is operating (YES atStep S110), the control section 170 performs an operation of detectingangular velocity by the angular velocity sensor 130 (Step S114).

When judged that the angular velocity sensor 130 is not operating (NO atStep S110), the control section 170 activates the angular velocitysensor 130 (Step S112), and performs an operation of detecting angularvelocity by the angular velocity sensor 130 (Step S114).

That is, when there is a magnetic field disturbance or magnetic anomalyand the output of the magnetic sensor 120 is not reliable, the controlsection 170 selects the method of detecting angular velocity by theangular velocity sensor 130.

Regarding the angular velocity detected by the magnetic gyro sensor atStep S108 or the angular velocity detected by the angular velocitysensor at Step S114, the control section 170 associates it with timedata, and stores it in the predetermined storage area of the memorysection 180 as angular velocity data (Step S116). Also, the controlsection 170 uses it when, for example, generating information regardingthe user's exercise status, movement trajectory, etc.

This series of processing operations of the flowchart of FIG. 3 by thecontrol section 170 is periodically repeated, for example, atpredetermined time intervals.

Note that, although omitted in the flowchart of FIG. 3 , the controlsection 170 constantly monitors for an input operation of stopping orending the series of processing operations and change in the operationstatus while performing these processing operations, and forcibly endsthis series of processing operations when the input operation or thestatus change is detected.

More specifically, the control section 170 detects a power off operationby the user, a decrease in the battery remaining amount of the powersupply section 190, anomaly in a function or an application beingexecuted, or the like, and forcibly stops and ends the series ofprocessing operations.

In the angular velocity acquisition method according the presentembodiment, for example, the following method can be applied as themethod of detecting (calculating) angular velocity by the magnetic gyrosensor constituted by the magnetic sensor 120 or constituted includingthe acceleration sensor 110 and the magnetic sensor 120.

That is, first, the control section 170 calculates speed inthree-dimensional space based on the temporal change amounts of theoutputs of the acceleration sensor 110 and the magnetic sensor 120.Here, the strength and direction of geomagnetism in a specific positionand area are basically constant and do not change. With acceptance onthis point, for example, if a change in the direction of geomagnetism isdetected when the magnetic sensor 120 is being operated at fixed timeintervals, the control section 170 judges that the change in thedirection of geomagnetism has occurred by the rotation of the magneticsensor 120 (electronic apparatus 100), and detects the rotation status.As a result, angular velocities related to three axes defined by themagnetic sensor 120 can be calculated.

As the magnetic data usage method according to the present embodiment,for example, the following methods can be applied.

That is, geomagnetism in three axial directions which is detected by themagnetic sensor 120 in the present embodiment is used when angularvelocity is calculated by the acceleration sensor 110 and the magneticsensor 120 functioning as a magnetic gyro sensor as described above. Inaddition, it is used as the output of the magnetic sensor 120 itselfwhen information regarding the user's exercise status, movementtrajectory, etc. is generated.

Accordingly, in the present embodiment, a data usage method using atime-sharing technique can be adopted in which an operation (A) wheregeomagnetism data in three axial directions detected by the magneticsensor 120 as shown in (a) of FIG. 5 is used by the magnetic gyro sensorand an operation (B) where the data is used with the magnetic sensor 120being used as it is are alternately and repeatedly performed atpredetermined time intervals, as shown in (b) of FIG. 5 .

By the usage of a series of data detected by the magnetic sensor 120being switched for every period as described above, the processing loadon the control section 170 can be reduced.

Also, in the present embodiment, a data usage method using a parallelprocessing technique can be adopted in which the operation (A) where thegeomagnetism data in three axial directions shown in (a) of FIG. 5 isused by the magnetic gyro sensor and the operation (B) where the data isused with the magnetic sensor 120 being used as it is are simultaneouslyperformed in parallel, as shown in (c) of FIG. 5 .

By data detected by the magnetic sensor 120 being shared in parallel byuse as just described, no data gap occurs and reliable angular velocity,exercise information, and the like can be provided.

As described above, in the present embodiment, when a magnetic fieldaround the magnetic sensor 120 is stable, the angular velocity sensor130 enters a stop state and angular velocity is acquired by the magneticgyro sensor using the outputs of the acceleration sensor 110 and themagnetic sensor 120.

As a result of this configuration, the acceleration sensor 110 and themagnetic sensor 120 whose power consumptions are small as compared tothat of the angular velocity sensor 130 can be used. Accordingly, thepower consumption of the electronic apparatus 100 is reduced, whichcontributes to the improvement of the driving time. In addition, areliable and adequate angular velocity can be acquired.

More specifically, magnetic sensors and acceleration sensors generallyoperate with an electric current of the order of tens to hundreds ofmicroamperes. By contrast, angular velocity sensors operate with anelectric current of the order of milliamperes. Thus, by the angularvelocity acquisition method according to the present embodiment beingapplied, the power consumption of the electronic apparatus 100 can besignificantly reduced as compared to a method where angular velocity isacquired only by an angular velocity sensor.

In addition, when the magnetic sensor 120 is affected by disturbancenoise and therefore its output is abnormal, the angular velocity sensor130 which is not affected by the surrounding magnetic field can be used,so that a reliable and adequate angular velocity can be acquired.

(Modification Example)

Next, a modification example of the above-described embodiment isdescribed.

In the angular velocity acquisition method according to theabove-described embodiment, the method of judging whether or not thereis any disturbance or magnetic anomaly in a magnetic field around themagnetic sensor 120 (Step S104) has been described, in which angularvelocity detected (calculated) by the magnetic gyro sensor constitutedby the magnetic sensor 120 or by the acceleration sensor 110 and themagnetic sensor 120 and angular velocity detected by the angularvelocity sensor 130 are compared with each other. However, the presentinvention is not limited thereto and the following methods can beadopted.

(1) The control section 170 judges whether or not the total value ofoutputs in three axial directions from the magnetic sensor 120 or thevalue of an output in a specific axial direction is larger than athreshold value set in advance.

Then, the control section 170 judges that there is a disturbance ormagnetic anomaly in a magnetic field around the magnetic sensor 120 whenthe output value is larger than the threshold value, or judges thatthere is no disturbance or magnetic anomaly in the magnetic field aroundthe magnetic sensor 120 when the output value is not larger than thethreshold value.

Here, in order to prevent the reduction of the judgment accuracy due toa sudden or momentary magnetic field disturbance or magnetic anomaly,the control section 170 should preferably judge that there is a magneticfield disturbance or magnetic anomaly when a state where the outputvalue of the magnetic sensor 120 is larger than the threshold valuecontinues for a predetermined time or is detected more than apredetermined number of times in a predetermined period.

(2) The control section 170 judges whether there is change in the outputof the magnetic sensor 120 when there is no change in the output of theacceleration sensor 110 or when the value of a change in the output ofthe acceleration sensor 110 is equal to or less than a threshold valueset in advance.

Then, when a change occurs in the output of the magnetic sensor 120 orwhen the value of a change in the output of the magnetic sensor 120 isequal to or larger than a threshold value set in advance, the controlsection 170 judges that there is a disturbance or magnetic anomaly in amagnetic field around the magnetic sensor 120.

That is, in a normal situation, when the electronic apparatus 100 is notbeing moved or used, no change occurs in the outputs of the accelerationsensor 110 and the magnetic sensor 120. Accordingly, if a change occursin the output of the magnetic sensor 120 in this situation, a judgmentcan be made that the magnetic sensor 120 is being affected by adisturbance noise (magnetic field disturbance or magnetic anomaly).

(3) The control section 170 calculates the strength and direction of amagnetic field at the current location of the electronic apparatus 100based on the output of the magnetic sensor 120, and judges whether thevalues of the strength and direction of the magnetic field(geomagnetism) at the current location are unusual values that aredifferent from the values of the usual strength and direction of themagnetic field.

That is, in any area on the earth, the strength and direction of eachmagnetic field attributed to geomagnetism are basically definite andalready known. Accordingly, when the values of the strength anddirection of a magnetic field calculated based on the output of themagnetic sensor 120 is unusual values that are different from the valuesof the usual strength and direction of the magnetic field, the controlsection 170 judges that there is a disturbance or magnetic anomaly inthe magnetic field around the magnetic sensor 120.

Here, information regarding the current location of the electronicapparatus 100 may be acquired by a positioning section using GPS or thelike being added to the structure of the electronic apparatus 100 shownin FIG. 2 . Also, a configuration may be adopted in which it is acquiredby the user selecting an area or a region where the electronic apparatus100 is currently located. Based on this information, the usual strengthand direction of a magnetic field can be estimated.

<Second Embodiment>

Next, an angular velocity acquisition method for an electronic apparatusaccording to a second embodiment of the present invention is describedwith reference to the drawings. Note that, here, descriptions of part ofthe method that is equal to the first embodiment are simplified.

FIG. 6 , FIG. 7A, FIG. 7B and FIG. 7C are flowcharts showing an exampleof the angular velocity acquisition method for the electronic apparatusaccording to the second embodiment.

In the first embodiment and its modification, the method has beendescribed in which where or not there is any disturbance or magneticanomaly in a magnetic field around the magnetic sensor 120 is judged,and a method for detecting angular velocity is selected based on aresult of this judgment.

In the second embodiment, in addition to this judgment processing,processing is performed in which whether the output of the magneticsensor 120 is reliable is judged, and calibration processing for themagnetic sensor 120 is performed based on a result of this judgment.

This angular velocity acquisition method (flowcharts in FIG. 6 , FIG.7A, FIG. 7B and FIG. 7C) for the electronic apparatus 100 is alsoachieved by the control section 170 performing processing according to apredetermined control program and a predetermined algorithm program, asin the first embodiment.

Here, the control section 170 corresponds to an offset judgment sectionand a calibration control section.

In the angular velocity acquisition method according to the secondembodiment, when the electronic apparatus 100 is turned on, theacceleration sensor 110, the magnetic sensor 120, and the angularvelocity sensor 130 are activated (Step S202), and the control section170 judges whether calibration processing for the magnetic sensor 120 isnecessary (Step S204), as shown in the flowchart of FIG. 6 .

Specifically, as in the case of the reliability judgment processing(Step S120 to Step S126) shown in the flowchart of FIG. 4 in the firstembodiment, the control section 170 synchronizes the acceleration sensor110 and the magnetic sensor 120 constituting a magnetic gyro sensor withthe angular velocity sensor 130 so as to operate them, and detectsangular velocity from each output therefrom (Step S120).

Subsequently, the control section 170 compares the individually detectedangular velocities with each other (Step S122).

Then, when the comparison result (difference) is within a predeterminedthreshold range (Step S124), the control section 170 judges thatcalibration processing is not necessary because the offset value of themagnetic sensor 120 is a known value and its output is reliable (StepS126).

Conversely, when the comparison result is not within the predeterminedthreshold range (Step S124), the control section 170 judges thatcalibration processing is necessary because the offset value of themagnetic sensor 120 has been changed from the known value and its outputis not reliable (Step S126).

When judged at Step S204 that calibration processing for the magneticsensor 120 is necessary (YES at Step S204), the control section 170performs predetermined calibration processing (Step S206).

Then, after performing the calibration processing, the control section170 performs processing operations equivalent to those of Step S104 toStep S116 in the first embodiment (the flowchart in FIG. 3 ), andacquires angular velocity data detected by the magnetic gyro sensor orthe angular velocity sensor 130.

Note that the calibration processing for the magnetic sensor 120 hereinmay be automatically performed by a well-known calibration method, ormay be manually performed by the user being prompted to perform it.

That is, the control section 170 judges whether or not there is anydisturbance or magnetic anomaly in a magnetic field around the magneticsensor 120 at this point (Step S208).

Then, when judged that there is no magnetic field disturbance ormagnetic anomaly (NO at Step S208), the control section 170 temporarilystops the sensing operation of the angular velocity sensor 130 (StepS210), and performs an operation of detecting angular velocity by themagnetic gyro sensor (Step S212).

Conversely, when judged that there is a magnetic field disturbance ormagnetic anomaly (YES at Step S208), the control section 170 starts theangular velocity sensor 130 (Step S214 and Step S216) to perform anangular velocity detection operation thereby (Step S218).

Then, the control section 170 associates the detected angular velocitywith time data, and stores it in the predetermined storage area of thememory section 180 as angular velocity data (Step S220).

Note that, in the processing of judging whether or not there is anydisturbance or magnetic anomaly in the magnetic field around themagnetic sensor 120 at Step S208, processing operations may be performedwhich are the same as those of the reliability judgment processing shownin the flowchart of FIG. 4 in the first embodiment.

As another method for judging whether or not there is any disturbance ormagnetic anomaly in the magnetic field around the magnetic sensor 120, amethod may be adopted in which, in the processing of judging whethercalibration processing for the magnetic sensor 120 is necessary at StepS204, whether or not there is a magnetic field disturbance or magneticanomaly is judged based on whether the result of the comparison(difference) between the angular velocities is within the predeterminedthreshold range.

Next, the control section 170 judges whether calibration processing forthe magnetic sensor 120 is necessary based on the reliability of theoutput of the magnetic sensor 120, as shown in the flowcharts of FIG.7A, FIG. 7B and FIG. 7C (Step S230, Step S240, and Step S250).

Specifically, in judgment processing at Step S230, the control section170 detects angular velocity by either the magnetic gyro sensor or theangular velocity sensor 130, acquires the data of the angular velocity(Step S220), and then performs processing operations that are the sameas those of the above-described processing (at Step S204) for judgingwhether or not calibration processing for the magnetic sensor 120 isnecessary.

That is, the control section 170 synchronizes the acceleration sensor110 and the magnetic sensor 120 constituting the magnetic gyro sensorwith the angular velocity sensor 130 so as to operate them, and judgeswhether a result of comparison (difference) between individuallydetected angular velocities is out of the predetermined threshold range.

When the comparison result is out of the predetermined threshold range(YES at Step S230), the control section 170 judges that calibrationprocessing is necessary because the offset value of the magnetic sensor120 has been changed from the known value and its output is notreliable.

In this case, the control section 170 returns to Step S206, performscalibration processing for the magnetic sensor 120, and then acquiresangular velocity data by performing the processing operations at StepS208 and the following steps.

Conversely, when the comparison result is within the predeterminedthreshold range (NO at Step S230), the control section 170 judges thatcalibration processing is not necessary because the offset value of themagnetic sensor 120 is normal and its output is reliable.

In this case, the control section 170 acquires angular velocity data byperforming the processing operations at Step S208 and the followingsteps without performing calibration processing for the magnetic sensor120.

In judgment processing at Step S240, the control section 170 judgeswhether time elapsed from preceding calibration processing for themagnetic sensor 120 has exceeded a predetermined threshold value.

When judged that the elapsed time has exceeded the threshold value (YESat Step S240), the control section 170 judges that calibrationprocessing is necessary because the offset value of the magnetic sensor120 may not be normal (accurate) and therefore its output is notreliable. In this case, the control section 170 returns to Step S206,and performs calibration processing for the magnetic sensor 120.

Conversely, when judged that the elapsed time has not exceeded thethreshold value (NO at Step S240), the control section 170 presumes thatthe offset value of the magnetic sensor 120 is a known value and itsoutput is reliable, and therefore judges that calibration processing isnot necessary. In this case, the control section 170 performs theprocessing operations at Step S208 and the following steps withoutperforming calibration processing for the magnetic sensor 120.

In judgment processing at Step S250, the control section 170 refers to ahistory of outputs of the magnetic gyro sensor collected in the past,and thereby judges whether or not there is any disturbance or magneticanomaly in the magnetic field around the magnetic sensor 120.

In this history of outputs of the magnetic gyro sensor, when the numberof times a magnetic field disturbance or magnetic anomaly has beenobserved is larger than a predetermined threshold value (YES at StepS250), the control section 170 judges that calibration processing isnecessary because the offset value of the magnetic sensor 120 may not benormal (accurate) and therefore its output is not reliable. In thiscase, the control section 170 returns to Step S206 and performscalibration processing for the magnetic sensor 120.

Conversely, when the number of times a magnetic field disturbance ormagnetic anomaly has been observed is less than the predeterminedthreshold value (NO at Step S250), the control section 170 judges thatcalibration processing is not necessary because the offset value of themagnetic sensor 120 is a known value and therefore its output isreliable. In this case, the control section 170 performs the processingoperations at Step S208 and the following steps without performingcalibration processing for the magnetic sensor 120.

As described above, in this embodiment, in addition to the processingoperations of the angular velocity acquisition method of the firstembodiment, the control of the execution of calibration processing forcorrecting the offset value of the magnetic sensor 120 is performedbased on whether the output of the magnetic sensor 120 is reliable.

As a result of this configuration, the offset value of the magneticsensor 120 constituting the magnetic gyro sensor can be constantlycorrected to an accurate value, whereby the power consumption of theelectronic apparatus 100 can be reduced and a more reliable and adequateangular velocity can be acquired.

(Modification Example)

Next, a modification example of the above-described embodiment isdescribed.

In the above-described embodiment, the processing for judging whethercalibration processing for the magnetic sensor 120 is necessary isperformed at Step S204 after the activation of each sensor. However, thepresent invention is not limited thereto. Specifically, a configurationmay be adopted in which, after the activation of each sensor, thecalibration processing for the magnetic sensor 120 at Step S206 isautomatically performed without the judgment processing at Step S204. Asa result of this configuration, the necessity judgment processingregarding calibration processing for the magnetic sensor 120 can beincluded in one of the processing operations at Step S230, Step S240 andStep S250, whereby a processing load immediately after the activation ofthe electronic apparatus 100 can be reduced.

Also, in the method of the present embodiment, when angular velocitiesindividually detected by the magnetic gyro sensor and the angularvelocity sensor are compared with each other based on the premise thatthe output of the angular velocity sensor is accurate, and the output ofthe magnetic gyro sensor is different from (different with reference to)that of the angular velocity sensor 130 by more than a threshold value,the offset value of the magnetic sensor 120 is judged to have beenchanged from a known value, and calibration processing is performed.However, the present invention is not limited thereto.

That is, a configuration may be adopted in which, when angularvelocities individually detected by the magnetic gyro sensor and theangular velocity sensor are compared with each other based on thepremise that the output of the magnetic gyro sensor is accurate, and theoutput of the angular velocity sensor 130 is different from (differentwith reference to) that of the magnetic gyro sensor by a valuesignificantly larger than a threshold value, the offset value of theangular velocity sensor 130 is judged to have been changed from a knownvalue, and calibration processing for the angular velocity sensor 130 isperformed. Here, the output of the magnetic sensor 120 constituting themagnetic gyro sensor can be maintained at an accurate value bycalibration processing being performed immediately after the activationof the acceleration sensor 110, the magnetic sensor 120, and the angularvelocity sensor 130, as shown at Step S206.

Moreover, in the present invention, a configuration may be adopted inwhich the method of judging whether calibration processing for themagnetic sensor 120 is necessary in the above-described embodiment andthe above-described method of judging whether calibration processing forthe angular velocity sensor 130 is necessary by judging whether theoffset value of the angular velocity sensor 130 has been changed from aknown value are both performed, whereby the offset value of the magneticsensor 120 and the offset value of the angular velocity sensor 130 aremaintained at known values.

By this configuration, the output of the angular velocity sensor 130 orthe outputs of the magnetic gyro sensor and the angular velocity sensor130 can be maintained at accurate values, whereby a reliable andadequate angular velocity can be acquired.

Furthermore, in the above-described embodiments and their modificationexamples, the method using the magnetic gyro sensor has been describedin which angular velocity is detected (calculated) using the outputs ofthe acceleration sensor 110 and the magnetic sensor 120. However, thepresent invention is not limited thereto and a method may be adopted inwhich angular velocity is detected (calculated) based only on the outputof the magnetic sensor 120).

While the present invention has been described with reference to thepreferred embodiments, it is intended that the invention be not limitedby any of the details of the description therein but includes all theembodiments which fall within the scope of the appended claims.

What is claimed is:
 1. An electronic apparatus comprising: a magneticgyro sensor comprising a magnetic sensor; an angular velocity sensor,wherein power consumption by the angular velocity sensor is larger thanpower consumption by the magnetic gyro sensor; and a processorconfigured to: control the magnetic sensor to detect a magnetic fieldaround the electronic apparatus; judge whether there is disturbance inthe magnetic field around the electronic apparatus based on the magneticfield detected by the magnetic sensor; in response to judging that thereis no disturbance in the magnetic field around the electronic apparatus,control use the magnetic gyro sensor to detect an angular velocity of aspatial movement of the electronic apparatus; and in response to judgingthat there is disturbance in the magnetic field around the electronicapparatus, control use the angular velocity sensor to detect the angularvelocity of the spatial movement of the electronic apparatus.
 2. Theelectronic apparatus according to claim 1, wherein the processor isconfigured to: determine whether a difference between a first angularvelocity detected in a first period by the angular velocity sensor witha second angular velocity detected in the first period by the magneticgyro sensor, based on the magnetic field detected by the magneticsensor, is within a threshold range; in response to determining that thedifference is within the threshold, judge that there is no disturbancein the magnetic field around the electronic apparatus; in response tojudging that there is no disturbance in the magnetic field around theelectronic apparatus: stop operation of the angular velocity sensor; andcontrol the magnetic gyro sensor to detect the angular velocity of thespatial movement of the electronic apparatus after stopping operation ofthe angular velocity sensor; and in response to determining that thedifference is not within the threshold, judge that there is disturbancein the magnetic field around the electronic apparatus.
 3. The electronicapparatus according to claim 1, wherein the processor is configured to:determine whether the magnetic field detected by the magnetic sensorexceeds a threshold value; in response to determining that the magneticfield detected by the magnetic sensor does not exceed the thresholdvalue, judge that there is no disturbance in the magnetic field aroundthe electronic apparatus; and in response to determining that themagnetic field detected by the magnetic sensor does exceed the thresholdvalue, judge that there is disturbance in the magnetic filed around theelectronic apparatus.
 4. The electronic apparatus according to claim 1,wherein the magnetic gyro sensor further comprises an accelerationsensor, and wherein the processor is configured to: control theacceleration sensor to detect an acceleration of the electronicapparatus; determine whether a change occurs in the magnetic fielddetected by the magnetic sensor and whether a change occurs in theacceleration detected by the acceleration sensor; in response todetermining that a change occurs in the magnetic field detected by themagnetic sensor and a change does not occur in the acceleration detectedby the acceleration sensor, judge that there is disturbance in themagnetic field around the electronic apparatus; and in response todetermining that a change does not occur in the magnetic field detectedby the magnetic sensor and a change does not occur in the accelerationdetected by the acceleration sensor, judge that there is no disturbancein the magnetic field around the electronic apparatus.
 5. The electronicapparatus according to claim 1, wherein the processor is configured to:determine whether a strength, a direction or both of the magnetic fielddetected by the magnetic sensor is different from known values of astrength and direction of a magnetic field attributed to geomagnetism ata geographical location of the electronic apparatus; in response todetermining that the strength, the direction or both of the magneticfield detected by the magnetic sensor is different from the known valuesof the strength and direction of the magnetic field attributed togeomagnetism at the geographical location of the electronic apparatus,judge that there is disturbance in the magnetic field around theelectronic apparatus; and in response to determining that the strength,the direction or both of the magnetic field detected by the magneticsensor is not different from the known values of the strength anddirection of the magnetic field attributed to geomagnetism at thegeographical location of the electronic apparatus, judge that there isno disturbance in the magnetic field around the electronic apparatus. 6.The electronic apparatus according to claim 1, wherein the processor isconfigured to: judge whether there is an anomaly in an offset value ofthe magnetic sensor or the angular velocity sensor; and control toexecute calibration processing for correcting the offset value of themagnetic sensor or the angular velocity sensor, based on a result ofjudgment of whether there is the anomaly in the offset value.
 7. Theelectronic apparatus according to claim 6, wherein the processor isconfigured to: determine whether a difference between a first angularvelocity detected in a first period by the angular velocity sensor and asecond angular velocity detected in the first period by the magneticgyro sensor is out of a threshold range; and in response to determiningthat the difference is out of the threshold range, judge that there isan anomaly in the offset value of the magnetic sensor or the angularvelocity sensors, and control to execute calibration processing forcorrecting the offset value of the magnetic sensor or the angularvelocity sensor.
 8. The electronic apparatus according to claim 6,wherein the processor is configured to: determine whether time elapsedfrom preceding calibration processing for the magnetic sensor or theangular velocity sensor exceeds a threshold value; and in response todetermining that the time elapsed exceeds the threshold value, controlto execute calibration processing for the magnetic sensor or the angularvelocity sensor.
 9. The electronic apparatus according to claim 6,wherein the processor is configured to: determine, by reference to ahistory of angular velocities detected in a predetermined period by themagnetic gyro sensor or the angular velocity sensor, whether number oftimes a disturbance in the magnetic field around the electronicapparatus is detected is larger than a threshold value; and in responseto determining that the number of times a disturbance in the magneticfield around the electronic apparatus is detected is larger than thethreshold value, judge that there is an anomaly in the offset value ofthe magnetic sensor or the angular velocity sensor, and control toperform calibration processing for the magnetic sensor or the angularvelocity sensor.
 10. A method for controlling an electronic apparatuscomprising: a magnetic gyro sensor comprising a magnetic sensor; and anangular velocity sensor, wherein power consumption by the angularvelocity sensor is larger than power consumption by the magnetic gyrosensor, wherein the method comprises: controlling the magnetic sensor todetect a magnetic field around the electronic apparatus; determiningwhether there is disturbance in the magnetic field around the electronicapparatus based on the magnetic field detected by the magnetic sensor;in response to determining that there is no disturbance in the magneticfield around the electronic apparatus, controlling using the magneticgyro sensor to detect an angular velocity of a spatial movement of theelectronic apparatus; and in response to determining that there isdisturbance in the magnetic field around the electronic apparatus,controlling using the angular velocity sensor to detect the angularvelocity of the spatial movement of the electronic apparatus.
 11. Themethod according to claim 10, comprising: determining whether adifference between a first angular velocity detected in a first periodby the angular velocity sensor with a second angular velocity detectedin the first period by the magnetic gyro sensor, based on the magneticfield detected by the magnetic sensor, is within a threshold range; inresponse to determining that the difference is within the threshold,judging that there is no disturbance in the magnetic field around theelectronic apparatus; in response to judging that there is nodisturbance in the magnetic field around the electronic apparatus:stopping operation of the angular velocity sensor; and controlling themagnetic gyro sensor to detect the angular velocity of the spatialmovement of the electronic apparatus after stopping operation of theangular velocity sensor; and in response to determining that thedifference is not within the threshold, judging that there isdisturbance in the magnetic field around the electronic apparatus. 12.The method according to claim 10, comprising: determining whether themagnetic field detected by the magnetic sensor exceeds a thresholdvalue; in response to determining that the magnetic field detected bythe magnetic sensor does not exceed the threshold value, judging thatthere is no disturbance in the magnetic field around the electronicapparatus; and in response to determining that the magnetic fielddetected by the magnetic sensor does not exceed the threshold value,judging that there is disturbance in the magnetic field around theelectronic apparatus.
 13. The method according to claim 10, wherein themagnetic gyro sensor further comprises an acceleration sensor, andwherein the method comprises: controlling the acceleration sensor todetect an acceleration of the electronic apparatus; determining whethera change occurs in the magnetic field detected by the magnetic sensorand whether a change occurs in the acceleration detected by theacceleration sensor; in response to determining that a change occurs inthe magnetic field detected by the magnetic sensor and a change does notoccur in the acceleration detected by the acceleration sensor, judgingthat there is disturbance in the magnetic field around the electronicapparatus; and in response to determining that a change does not occurin the magnetic field detected by the magnetic sensor and a change doesnot occur in the acceleration detected by the acceleration sensor,judging that there is no disturbance in the magnetic field around theelectronic apparatus.
 14. The method according to claim 10, comprising:determining whether a strength, a direction or both of the magneticfield detected by the magnetic sensor is different from known values ofa strength and direction of a magnetic field attributed to geomagnetismat a geographical location of the electronic apparatus; in response todetermining that the strength, the direction or both of the magneticfield detected by the magnetic sensor is different from the known valuesof the strength and direction of the magnetic field attributed togeomagnetism at the geographical location of the electronic apparatus,judging that there is disturbance in the magnetic field around theelectronic apparatus; and in response to determining that the strength,the direction or both of the magnetic field detected by the magneticsensor is not different from the known values of the strength anddirection of the magnetic field attributed to geomagnetism at thegeographical location of the electronic apparatus, judging that there isno disturbance in the magnetic field around the electronic apparatus.15. A non-transitory computer-readable storage medium having storedthereon a program that is executable by a computer of an electronicapparatus, wherein the electronic apparatus comprises: a magnetic gyrosensor comprising a magnetic sensor; and an angular velocity sensor,wherein power consumption by the angular velocity sensor is larger thanpower consumption by the magnetic gyro sensor; wherein the program isexecutable by the computer to at least perform: controlling the magneticsensor to detect a magnetic field around the electronic apparatus;determining whether there is disturbance in the magnetic field aroundthe electronic apparatus based on the magnetic field detected by themagnetic sensor; in response to determining that there is no disturbancein the magnetic field around the electronic apparatus, controlling usingthe magnetic gyro sensor to detect an angular velocity of a spatialmovement of the electronic apparatus; and in response to determiningthat there is disturbance in the magnetic field around the electronicapparatus, controlling using the angular velocity sensor to detect theangular velocity of the spatial movement of the electronic apparatus.